
class OrderDetailController {
    constructor($rootScope,$scope,$state,$compile,UserService,AccountService,LotteryService){
        Object.assign(this,{$rootScope,$scope,$state,$compile,UserService,AccountService,LotteryService});
        this.projectId= this.$state.params.proid;
        this.init(this.projectId);
    }

    /**
     * 初始化
     */
    init(projectId) {
        let self = this;
        self.AccountService.getOrderDetail(projectId).then(_success).catch(_error);
        function _success(data) {
            self.orderDtail = data;
        }
        function _error(reason) {
            console.log(JSON.stringify(reason));
            let type = typeof reason;
            layer.open({
                           icon:2,
                           title:"错误！",
                           content:type=='object'?reason.text:reason,
                           btn:["好的"],
                           yes:function (index,layerno) {
                               layer.close(index);
                           }
                       });
        };
    }

}
OrderDetailController.$inject = ["$rootScope","$scope","$state","$compile","UserService","AccountService","LotteryService"];

export default OrderDetailController;